package com.guohe3.just.common.utils;

import com.guohe3.just.common.constants.Constants;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class ScheduledUtil {
    @Autowired
    private RedisTemplate redisTemplate;
    @Scheduled(cron="0 0 0 ? * MON")
    public void WeekAdd(){
        redisTemplate.opsForValue().increment(Constants.XIAOLI_KEY, 1L);
    }
}
